extends "../xianghe-3/xianghe-3.gd"


var baseId = ""
var upText1 = "珊瑚海阴云伤害提高100%"
var upText2 = "珊瑚海阴云额外对2名敌人造成伤害"
func _extInit():
	._extInit()
	lv = 4             #等级的设置
	addSkill("每{cd}秒对距离最远的2个敌人造成[航空*1]的技能伤害，并延长其技能冷却时间2秒", "珊瑚海阴云", "xianghe4", 6)

func _castCdSkill(id):
	._castCdSkill(id)
	if id == "xianghe4":
		xianghe4()

func xianghe4():
	var chas = getAllChas(1)
	chas.sort_custom(self, "sortByDistanceDesc")
	var arr = []
	while arr.size() < p42 and not chas.empty():
		arr.append(chas.pop_front())
	for i in arr:
		azurHurtChara(i, att.air, sys.HurtType.WEAPON, sys.AtkType.SKILL, "珊瑚海阴云", false, p41)
		for j in i.skills:
			j.nowTime -= 2

var p41 = 1
var p42 = 2
func upgrade():
	.upgrade()
	if upgraded == 1:
		p41 = 2
	if upgraded == 2:
		p42 = 4